# openFPGALoader -b tangnano9k pack.fs
# rm -f top.json top_pnr.json pack.fs

yosys -p "read_verilog top.v ../soc.v ../cpu.v ../control_unit.v ../data_path.v alu.v ../rom.v ../ram.v ../pc.v ../reg_file.v ../gpio.v ../timer.v; synth_gowin -json top.json"
nextpnr-himbaechel --json top.json --freq 27 --write top_pnr.json --device GW1NR-LV9QN88PC6/I5 --vopt family=GW1N-9C --vopt cst=tangnano9k.cst
gowin_pack -d GW1N-9C -o pack.fs top_pnr.json
